import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_learn/app/common/widgets/widgets.dart';
import 'package:getx_learn/app/modules/state_manager_demo/modules/dependency_injection/modules/get_put_page1/controllers/get_put_page1_controller.dart';

import '../controllers/get_put_page2_controller.dart';

class GetPutPage2View extends StatelessWidget {
  GetPutPage2View({Key? key}) : super(key: key);

  final controller = Get.find<GetPutPage1Controller>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: getAppBar(context: context, title: "GetPutPage2View"),
      body: Center(
        child: Column(
          children: [
            GetX<GetPutPage1Controller>(
              init: controller,
              initState: (_) {},
              builder: (_) {
                return Text('上一页的结果 value -> ${_.count}');
              },
            ),
            Divider(),
          ],
        ),
      ),
    );
  }
}
